﻿using ProtoBuf;

namespace ToyChat.BuiltinModules
{
    /// <summary>
    /// This message is sent when a user joins (or wishes to join) a channel
    /// </summary>
    [ProtoContract(Name = "Core.JoinMessage")]
    public class JoinMessage
    {
        /// <summary>
        /// Gets or Sets a reference to a <see cref="RemoteUser"/> object that represents the user that joined the channel
        /// </summary>
        [ProtoMember(1)]
        public RemoteUser User { get; set; }

        /// <summary>
        /// Gets or Sets the ID of the channel the user has joined / wishes to join
        /// </summary>
        [ProtoMember(2, IsRequired = false)]
        public int? ChannelID { get; set; }

        /// <summary>
        /// Gets or Sets the name of the channel that the user wishes to join
        /// </summary>
        [ProtoMember(3, IsRequired = false)]
        public string ChannelName { get; set; }

        /// <summary>
        /// Gets or Sets the password of the channel the user joined (This is nulled when received by the server before being sent to the users in the channel)
        /// </summary>
        [ProtoMember(4, IsRequired = false)]
        public string ChannelPassword { get; set; }
    }
}